<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>订单列表-{$tpshop_config['shop_info_store_title']}</title>
    <meta name="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
    <link rel="stylesheet" href="__STATIC__/css/index.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/css/myuser.css" type="text/css">
</head>

<body>
<!--------头部开始-------------->
<include file="Public/header" />
<include file="Public/topnav" />
<!--------头部结束-------------->

<div class="page_pad">
  <div class="page_margin">
    <div class="page_radius page_hidden">
      <div class="page_padin">
        <div class="user_page">
          <div class="user_poi">当前位置：首页 &gt; <span>我购买的网店</span></div>
          <div class="user_left">
            <include file="User/userleft" />
          </div><!--user_left-->

          <div class="user_right">
            <div class="order_page">
              <div class="uright_tabs">
                <ul>
                  <li><a href="{:U('Home/User/seller_list')}">我出售的网店</a></li>
                  <li><a class="on" href="{:U('Home/User/order_list')}">我购买的网店</a></li>
                  <li><a href="{:U('Home/User/goods_collect')}">我收藏的网店</a></li>
                  <div class="clear"></div>
                </ul>
              </div><!--uright_tabs-->
              
              <div class="order_list">
                <div class="order_ttable">
                <table>
                  <tr>
                    <td width="250"><div class="order_ttli"><div class="h1">标题</div></div></td>
                    <td width="140"><div class="order_ttli"><div class="h1">出售价格</div></div></td>
                    <td width="200"><div class="order_ttli"><div class="h1">消保金额</div></div></td>
                    <!--<td width="100"><div class="order_ttli"><div class="h1">销售状态</div></div></td>-->
                    <td width="140">
                      <div class="order_ttli">
                        <div class="h1">交易状态</div>
                        <div class="order_ttli_in">
                          <ul>
                            <li><a href="{:U('order_list')}">全部</a></li>
                            <!--<li><a href="{:U('order_list',array('status_id'=>1))}">求购待确认</a></li>-->
                            <li><a href="{:U('order_list',array('status_id'=>1))}">待付款</a></li>
                            <li><a href="{:U('order_list',array('status_id'=>2))}">正在交易</a></li>
                            <li><a href="{:U('order_list',array('status_id'=>3))}">交易完成</a></li>
                            <li><a href="{:U('order_list',array('status_id'=>4))}">退款中</a></li>
                          </ul>
                        </div>
                      </div>
                    </td>
                    <td><div class="order_ttli"><div class="h1">操作</div></div></td>
                  </tr>
                </table>
                </div>
                <div class="order_ul">
                <!------------------------------->
                <foreach name="lists" item="v" key="k">
                  <div class="order_li">
                    <div class="order_libor">
                      <div class="order_lih1">
                        <div class="order_libor2">
                          <span class="order_h1">订单编号：{$v.order_sn}<a href="{:U('Home/User/order_detail',array('id'=>$v['order_id']))}"  >【订单信息】</a></span>
                          <span class="order_h2"><span class="pad">生成时间：{$v.add_time|date='Y-m-d H:i',###} </span></span>
                          <!--<span class="order_h3">支付剩余时间：2天23小时59分</span>-->
                        </div>
                      </div><!--order_lih1-->

                      <div class="order_lih2">
                        <div class="order_libor2">

                          <table>
                            <tr>
                              <td align="left" width="250">
                                <div class="order_tt">
                                  <a href="{:U('Home/Goods/goodsInfo',array('id'=>$v['goods_id']))}" target="_blank">
                                  <span>
                                    <php>if($v[goods][goods_type]==3){</php>
                                     <img src="__STATIC__/images/sico_tm.png" />
                                    <php>}elseif($v[goods][goods_type]==4){</php>
                                     <img src="__STATIC__/images/sico_tb.png" />
                                    <php>}elseif($v[goods][goods_type]==5){</php>
                                     <img src="__STATIC__/images/sico_jd.png" />
                                    <php>}elseif($v[goods][goods_type]==6){</php>
                                     <img src="__STATIC__/images/sico_qt.png" />
                                    <php>} </php>
                                  </span>
                                  {$v.goods.seller_title}
                                  </a>
                                </div>
                              </td>
                              <td width="140"><span class="order_pp">￥<span>{$v.goods.price}</span></span></td>
                              <td width="200">
                                <p><span class="order_pp">￥<span>{$v.goods.b_price}</span></span></p>
                                <p>技术年费(<span class="order_pp">￥<span>{$v.goods.j_price}</span></span>)</p>
                              </td>
                              <!--<td width="100"><php>if($v[goods][status]==1){</php>待售<php>}elseif($v[goods][status]==3){</php>过户中<php>}elseif($v[goods][status]==4){</php>已完成<php>}</php></td>-->
                                <td width="140"> {$v.order_id|get_order_status}</td>


                                <td>
                                    <if condition="$v[button] neq null">
                                        <if condition="$v[button]['pay'] neq null">
                                            <a href="{:U('/Home/User/order_pay',array('order_id'=>$v[order_id]))}">付款</a>
                                        </if>
                                        <if condition="$v[button]['cancel'] neq null">
                                            <!--<a href="javascript:void(0)" onclick="cancel_order({$v.order_id})">取消</a>-->
                                            <!--<a href="{:U('delete_order',array('order_id'=>$v[order_id]))}" >删除</a>-->
                                            <a href="javascript:;" onclick="delete_order('{$v.order_id}')">删除</a>

                                        </if>

                                        <if condition="$v[button][refund] neq null ">
                                            <a href="{:U('/Home/User/return_order',array('order_id'=>$v[order_id]))}">申请退款</a>&nbsp;




                                        </if>

                                        <if condition="$v[button]['delete'] neq null">
                                            <a href="javascript:;" onclick="delete_order('{$v.order_id}')">删除</a>

                                            <!--<a href="{:U('delete_order',array('order_id'=>$v[order_id]))}" >删除</a>-->
                                        </if>
                                        <else/>


                                        <if condition="$v[is_return] eq '0' " >
                                            已申请退款
                                            <elseif condition="$v[is_return] eq '1'"/>
                                            已完成退款
                                            <a href="javascript:;" onclick="delete_order('{$v.order_id}')">删除</a>
                                            <!--<a href="{:U('delete_order',array('order_id'=>$v[order_id]))}" >删除</a>-->
                                            <elseif condition="$v[is_return] eq '2'"/>
                                            申请已被拒绝
                                            <span class="reject_why">
                                              <span class="reject_zw" onmouseover="reject_show('{$v[return_info]}',this)" onmouseout="reject_hide()"></span>
                                              <i class="icon-iconhelp"></i>
                                              <!--<span id="reject_info" style="display:none">{$v[return_info]}</span>-->
                                            </span>
                                            <!--<a href="{:U('delete_order',array('order_id'=>$v[order_id]))}" >删除</a>-->
                                            <a href="javascript:;" onclick="delete_order('{$v.order_id}')">删除</a>


                                            <else/>
                                            --
                                        </if>



                                    </if>












                                </td>

                           <!--   <php>if($v[order_status]==4){</php>
                                  <td width="140"><span class="order_pp2">    该店铺已被他人购买    </span></td>
                                  <td>
                                    <a href="{:U('delete_order',array('order_id'=>$v[order_id]))}" >删除</a>
                                  </td>
                              <php>}else{</php>
                                <php>if($v[pay_status]==0){</php>
                                <td width="140"><span class="order_pp2">    等待买家付款    </span></td>
                                <td>
                                  <a href="{:U('/Home/User/order_pay',array('order_id'=>$v[order_id]))}">付款</a>&nbsp;
                                  <a href="javascript:void(0)" onclick="cancel_order({$v.order_id})">取消</a>
                                </td>
                                <td> {$v.order_id|get_order_status}</td>
                                <td></td>








                                <php>}elseif($v[pay_status]==1){</php>
                                        <php>if($v[order_status]==0){</php>
                                        <td width="140"><span class="order_pp2">已支付/待确认</span></td>
                                        <td>
                                                &#45;&#45;
                                        </td>
                                    <php>}elseif($v[order_status]==1){</php>
                                    <td width="140"><span class="order_pp2">过户中</span></td>
                                    <td>
                                      <if condition="$v[is_refund] eq 1 ">
                                        <a href="{:U('/Home/User/return_order',array('order_id'=>$v[order_id]))}">申请退款</a>&nbsp;
                                        <else/>
                                        &#45;&#45;
                                      </if>
                                    </td>
                                    <php>}elseif($v[order_status]==6){</php>
                                    <td width="140"><span class="order_pp2">已完成</span></td>
                                    <td width="140">&#45;&#45;</td>
                                    <php>}elseif($v[order_status]==5){</php>
                                        <td width="140"><span class="order_pp2">已退款</span></td>
                                        <td width="140">&#45;&#45;</td>
                                    <php>}elseif($v[order_status]==2){</php>
                                    <td width="140"><span class="order_pp2">退款中</span></td>
                                    <td width="140">&#45;&#45;</td>
                                    <php>}</php>
                                <php>} </php>
                              <php>} </php>-->

                            </tr>
                          </table>
                        </div>
                      </div><!--order_lih2-->
                    </div><!--order_libor-->
                  </div><!--order_li-->
                </foreach>
                </div><!--order_ul-->
                <div>{$page}</div>

                <!------------------------------->
              </div><!--order_list-->
            </div><!--order_page-->
          </div><!--user_right-->
          <div class="clear"></div>
        </div><!--user_page-->
      </div><!--page_padin-->
    </div><!--page_radius-->
  </div><!--page_margin-->
</div><!--page_pad-->

<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->


</body>
<script>
$(document).ready(function(){
	$(".order_ttli").mousemove(function(){
		$(this).find(".order_ttli_in").show();
	});
	
	$(".order_ttli").mouseout(function(){
		$(this).find(".order_ttli_in").hide();
	});
});



function delete_order(id){
    layer.confirm('确定删除？', {
            title: "提示",
            btn: ['确定','取消'] //按钮
        }, function(){
//            location.href = "{:U('Home/User/delete_order')}?id="+id;
            location.href = "/index.php?m=Home&c=User&a=delete_order&order_id="+id;
        }
    );
}



function reject_show(str,o)
{
	layer.tips(str, o, {
		tips: [1, '#f39800'],
		skin: 'layui-layer-reject',
		time: 4000
	});
}

function reject_hide()
{
	layer.closeAll();
}
    /*$(function () {
     $("#h-s").click(function () {
     $('.ec-ta-x').css('left','124px');
     $('.ec-ta-x').css('width','110px');
     $(this).addClass("cullent");
     $('#q-s').removeClass("cullent");
     });
     });
     */
</script>

<script>
    $(function () {
        //高亮显示
        var active = '{$active_status}';
        if(!active)
            active = 'ALL';
        $('.wddd-li li').removeClass('wddd-red');
        $('#'+active).addClass('wddd-red');

        $("#h-s").mouseover(function () {
            $('.ec-ta-x').css('left','124px');
            $('.ec-ta-x').css('width','110px');
            $(this).addClass("cullent");
        });
        $("#h-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $('.ec-ta-x').css('width','124px');
            $(this).removeClass("cullent");
        });
    });
    $(function () {
        $("#q-s").mouseover(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).addClass("cullent");
        });
        $("#q-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
        });
    });
    //取消订单
    function cancel_order(id){
        /*if(!confirm("确定取消订单?"))
            return false;*/
		layer.confirm('确定取消订单？', {
			title: "提示",
			btn: ['确定','取消'] //按钮
			}, function(){
				location.href = "/index.php?m=Home&c=User&a=cancel_order&id="+id;
			}
		);
    }
</script>
</html>